package xyz.changlu.springbootexer.api.v1;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @ClassName BaseController
 * @Author ChangLu
 * @Date 2021/7/15 22:38
 * @Description TODO
 */
@Controller
public class BaseController {

    @GetMapping("/test")
    @ResponseBody
    public Person test(HttpServletResponse response) throws IOException {
        response.setHeader("Access-Control-Allow-Origin","*");
//        response.getWriter().write("changlugege");
        return new Person("changlu",18);
    }
}